import Vue from 'vue'
import Vuex from 'vuex'
import api from "@/api/index"

Vue.use(Vuex)
const store = new Vuex.Store({
	state: {
		moduleData: {},
	},
	mutations: {
		setModule(state, moduleData){
			state.moduleData = moduleData
			// console.log(state.moduleData, '==============================' )
		}
	},
	
	getters: {
		moduleData: moduleData => state.moduleData,
		getModuleData: (state) => (id) => {
			// console.log(state.moduleData, '#####################')
			// return state.moduleData.find(todo => todo.path === id)
			return state.moduleData[id]
		}
	},
	
})

export default store